<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <base href="{SITE_URL}">
        <title>网站管理</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <link rel="stylesheet" type="text/css" href="{CSS_URL}system.css"/>
        <link rel="stylesheet" type="text/css" href="{CSS_URL}treeview.css"/>
        <script type="text/javascript" src="{JS_URL}jquery.js"></script>
        <script type="text/javascript" src="{JS_URL}tree.js"></script>
        <style>
            body {background:#d2d8de;width:100%;}
        </style>
        <script>
            {get sql="select * from edufe_menu where parentid='$menu_site' and status=99 order by listorder desc" rows="1"}
            var top_menu_id = "{$r['id']}";
            {/get}
            $().ready(function(){
                $(window).resize(function(){
                    var widths = document.body.scrollWidth-220;
                    var heights = document.documentElement.clientHeight-65;
                    $("#right").css('height',heights).css('width',widths);
                    $("#admin_left").css('height',(heights));
                    var cut_nums = 0;
                    if(!$.browser.msie) cut_nums = 10;
                    var screen_h = parseInt(document.documentElement.clientHeight)-95-parseInt(cut_nums);
                    $("#tree").css("height",screen_h);
                });
                $(window).trigger('resize');
                //$('#treeview').treeview({root:0,url:'admin/menu.php?action=get_menu_list'});
                get_menu(top_menu_id);
                
                var offsetpos = offsetpos = ($.browser.msie && $.browser.version < 8) ? 0 : 2;
                $('#treeview').find('div,span').live('click',function(){
                    var offset = $(this).offset();
                    var offset3 = $("#tree_box").offset();
                    var y = offset.top - offset3.top - offsetpos;
                    $("#tree_click").show();
                    $("#tree_click").css("top",y+"px");
                })
                .live('mouseover',function(){
                    var offset = $(this).offset();
                    var offset3 = $("#tree_box").offset();
                    var y = offset.top - offset3.top - offsetpos;
                    $("#tree_bg").show();
                    $("#tree_bg").css("top",y+"px");
                })
                .live('mouseout',function(){
                    $("#tree_bg").hide();
                });
                $('.menu').removeClass('selected').click(function(){
                    $('.menu').removeClass('selected');
                    $(this).addClass('selected');
                })
                .eq(0).addClass('selected');
            });
            function get_menu(id)
            {
                $('#treeview').treeview({root:id,url:'admin/menu.php?action=get_menu_list',click:function(url){
                    $('#right').attr('src',url);
                }});
            }
            function top_menu(id,obj)
            {
                get_menu(id);
                $('a.menu').removeClass('selected');
                $(obj).addClass('selected');
            }
            function parent_file_list(obj)
            {
                right.parent_file_list(obj);
            }
        </script>
    </head>
    <body scroll="no">
        <div id="header">
            <div class="logo">网站信息管理系统</div>
            <p id="info_bar"> 用户名：<strong class="font_arial white">{$_SESSION['current_user']['username']}</strong> ，角色： <strong> {loop $_SESSION['current_user']['roles'] $r}{$r['rolename']} {/loop}</strong>  | <a class="white" href="admin/logout.php">退出登录</a> | <a target="_blank" class="white" href="{SITE_URL}">网站首页</a>
            {php $hook_obj->op_hook('after_admin_links', get_current_site(),array());}
            </p>
            <div id="menu">
                <ul>
                    {php $canview = get_view_resource('menu')}
                    
                    {get sql="select * from edufe_menu where parentid='$menu_site' and status=99 order by listorder desc"}
                    {if in_array($r['id'],$canview) || $current_user['usertype']==USER_TYPE_SUPER}
                    <li><a class="menu" href="javascript:void(0)" onclick="get_menu('{$r['id']}')"><span>{$r['name']}</span></a></li>
                    {/if}
                    {/get}
                </ul>
            </div>
        </div>
        <div id="admin_left" style="height: 307px;">
            <div class="inner" id="inner">
                <h4><span id="menu_name">我的面板</span></h4>
                <div style="top: 0pt; left: 6px;" class="p_r" id="tree_box">
                    <div style="top:34px;overflow:auto;" class="tree p_a" id="tree">
                        <ul id="treeview" class="filetree"></ul>
                    </div>
                    <div id="tree_bg" class="p_a" style="display:none;"></div>
                    <div id="tree_click" class="p_a" style="display:none;"></div>
                </div>
            </div>
        </div>
        <div id="admin_right">
            <div class="inner" id="inner">
                <div>
                    <iframe frameborder="0" style="height: 579px; width: 1063px; z-index: 111; background-color: rgb(255, 255, 255);" src="{$self_url}?action=main" id="right" name="right"></iframe>
                </div>
            </div>
        </div>
    </body>
</html>
